<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>主页</title>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/plugins/build/css/app.css" media="all">
</head>
<style>
    .module-title{
        display: block;
        width: 100%;
        height: 24px;
        line-height: 24px;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    .module-title .layui-breadcrumb {
        visibility: visible;
    }
    .module-title .back i{
        font-size: 20px;
    }
    .module-title .back span{
        vertical-align: top;
        color: #888;
    }
    .module-title .back span:hover{
        color: #5FB878;
    }
</style>
<body>
<div class="container">
    <div class="module-title">
        <span class="layui-breadcrumb">
            <a href="javascript:history.go(-1);" class="back">
                <i class="layui-icon back">&#xe603;</i>
                <span class="moduleName">文章内容</span>
            </a>
        </span>
    </div>
    <div id="content"></div>
</div>
<script src="/plugins/layui/layui.js"></script>
<script src="/plugins/common.js"></script>
<script>
    //详情
    var detailUrl = SERVER_URL+"/cmsContent/detail";

    layui.use(['jquery', 'form'], function() {
        var $ = layui.jquery;
        var form = layui.form;

        //判断新增or修改
        if(urlParam("id")){
            layer.load(2, {time: 5*1000});
            $.ajax({
                type: 'GET',
                url: detailUrl,
                data: {id: urlParam("id")},
                success: function (result) {
                    layer.closeAll();
                    if(result.code == 20000){
                        $("#content").html(result.data.content);
                    }else{
                        layer.msg(result.msg, {time: 1500});
                    }
                }
            });
        }
    });

    //地址栏参数
    function urlParam(name){
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)	return unescape(r[2]);
        return null;
    }
</script>
</body>

</html>
